package com.ikun.mapper;

import com.ikun.pojo.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {


    public List<Order> getAllOrder(Integer userId) ;


    public Order getOrderById(Integer id) ;

    List<Order> getOrderByUserId(Integer userId);
    //添加订单,添加的字段为userId,businessId,price,shippingAddress,
    public int addOrder(Order order);
    //在订单菜品表中,添加订单id为orderId对应的菜品信息
    public int addOrderDishes(Integer orderId,Integer dishesId,Integer quantity);
    //根据订单id修改订单的order_status
    public int updateOrderStatus(Integer orderId,Integer orderStatus);

    List<Map<String, Object>> getOrderDishesDescriptionByOrderId(Integer orderId);
}
